package com.nsl.my_youlai.bbu_return.enums.check;

import com.nsl.my_youlai.bbu2.enums.BoardTypeEnum;
import com.nsl.my_youlai.common.base.IBaseEnum;
import lombok.extern.slf4j.Slf4j;

import java.util.*;

@Slf4j
public enum BoardMatchSlotRulesEnum implements IBaseEnum<Integer> {

    HW_5G(0,"华为_5G"),
    HW_4G(1,"华为_4G"),
    HW_45G(1,"华为_4G/5G"),
    ZX_4G(2,"中兴_4G"),
    ZX_5G(3,"中兴_5G"),
    ZX_45G(3,"中兴_4G/5G"),
    DT_5G(4,"大唐_5G");



    //华为_4g
    private String vendorNetType;

    private Integer id;

    private Map<BoardTypeEnum,List<Integer>> boardTypeSlotIndexMap=new HashMap<>();

     BoardMatchSlotRulesEnum(Integer id,String vendorNetType){
         this.id=id;
         this.vendorNetType=vendorNetType.toLowerCase();
         System.out.println(("vendorNetType = " + vendorNetType));
         switch (this.vendorNetType){
             case "中兴_4g":
                 boardTypeSlotIndexMap.put(BoardTypeEnum.CONTROL_BOARD,Arrays.asList(1,2));
                 boardTypeSlotIndexMap.put(BoardTypeEnum.BASE_BAND_BOARD,Arrays.asList(3,4,5,6,7,8));
                 boardTypeSlotIndexMap.put(BoardTypeEnum.SWITCH_BOARD,Arrays.asList(3,4,5,6,7,8));
                 boardTypeSlotIndexMap.put(BoardTypeEnum.POWER_BOARD,Arrays.asList(15));
                 break;
             case "中兴_5g","中兴_4g/5g":
                 boardTypeSlotIndexMap.put(BoardTypeEnum.CONTROL_BOARD,Arrays.asList(1,2));
                 boardTypeSlotIndexMap.put(BoardTypeEnum.BASE_BAND_BOARD,Arrays.asList(3,4,6,7,8));
                 boardTypeSlotIndexMap.put(BoardTypeEnum.SWITCH_BOARD,Arrays.asList(3,4,6,7,8));
                 boardTypeSlotIndexMap.put(BoardTypeEnum.POWER_BOARD,Arrays.asList(5,13));
                 break;
             case "华为_4g", "华为_5g","华为_4g/5g":
                 boardTypeSlotIndexMap.put(BoardTypeEnum.CONTROL_BOARD,Arrays.asList(6,7));
                 boardTypeSlotIndexMap.put(BoardTypeEnum.BASE_BAND_BOARD,Arrays.asList(0,1,2,3,4,5));
                 boardTypeSlotIndexMap.put(BoardTypeEnum.POWER_BOARD,Arrays.asList(18,19));
                 break;
             case "大唐_5g":
                 boardTypeSlotIndexMap.put(BoardTypeEnum.CONTROL_BOARD,Arrays.asList(0,1));
                 boardTypeSlotIndexMap.put(BoardTypeEnum.BASE_BAND_BOARD,Arrays.asList(1,2,3,5,6,7));
                 boardTypeSlotIndexMap.put(BoardTypeEnum.POWER_BOARD,Arrays.asList(4,5));
                 break;
             default:
                 throw new RuntimeException(("厂家和网络类型错误"));

         }

    }


    @Override
    public Integer getValue() {
        return this.id;
    }

    @Override
    public String getLabel() {
        return this.vendorNetType;
    }

    @Override
    public String getEnumCnName() {
        return "厂家网络类型";
    }


    public Map<BoardTypeEnum,List<Integer>> getBoardTypeSlotIndexMap(){
         return this.boardTypeSlotIndexMap;
    }
}
